import request from './request'
export function queryspec () {
    return request({
      url: '/console/spec/querySpec.do',
      method: 'POST'
    })
  }
export function query ({currentPage = 1, perPage = 10} = {}) {
  return request({
    url: '/console/spec/specList.do',
    method: 'POST',
    body: {currentPage, perPage}
  })
}

export function create ({specName, parentId}={}) {
  return request({
    url: '/console/spec/addSpec.do',
    method: 'POST',
    body: {specName, parentId}
  })
}

export function edit ({id, specName, parentId}={}) {
  return request({
    url: '/console/spec/editSpec.do',
    method: 'POST',
    body: {id, specName, parentId}
  })
}

export function del (id) {
  return request({
    url: '/console/spec/deleteSpec.do',
    method: 'POST',
    body: {id}
  })
}

export function select (id) {
    return request({
      url: '/console/spec/querySpecCombo.do',
      method: 'POST',
      body: {id}
    })
  }

